/*
 * @Descripttion: 
 * @version: 
 * @Author: Xyl
 * @Date: 2023-04-27 14:57:35
 * @LastEditors: zoey
 * @LastEditTime: 2023-05-17 20:29:21
 */
const path = require("path");
const resolve = dir => path.join(__dirname, dir);
module.exports = {
    // 从publicPath: './',改为了下面的内容
    // 新增了outputDir：'dist'
    publicPath: '/',
    // outputDir: 'dist',
    devServer: {
        host: 'localhost',
        port: 8081,
        // lintOnSave: false,
        proxy: {
            '/apiquerylog': {
                // target: 'http://10.3.242.162:10081/',
                //target: 'http://10.3.242.162:10032/',
                target: 'http://192.3.96.98:10081',
                changeOrigin: true,
                ws: true,
                pathRewrite: {
                    '^/apiquerylog': ''
                }
            },
            // new
            '/apilog': {
                //target: 'http://101.43.6.148:8012/',
                //target: 'http://10.112.239.96:10081',
                target: 'http://192.3.96.98:10081',
                changeOrigin: true,
                ws: true,
                pathRewrite: {
                    '^/apilog': ''
                }
            },
            '/apilog2': {
                //target: 'http://101.43.6.148:8012/',
                //target: 'http://10.112.239.96:10081',
                target: 'http://192.3.96.98:10081',
                changeOrigin: true,
                ws: true,
                pathRewrite: {
                    '^/apilog2': ''
                }
            }
        },
    },
    css: {
        loaderOptions: { /* https://github.com/webpack-contrib/less-loader */
            less: {
                lessOptions: {
                    modifyVars: {
                        'primary-color': '##ECCBCB',
                        'link-color': '#CBECCB',
                        'border-radius-base': '2px',
                    },
                    javascriptEnabled: true,
                },
            },
        },
    },
    // 设置静态地址
    // resolve: {
    //     //省略扩展名
    //     extensions: ['.js','.vue','.json'],
    //     alias: {
    //         //resolve('src') 指项目根目录中的src目录
    //         //import somejs from "@/some.js"
    //         '@': resolve('src')
    //     }
    // },
    chainWebpack: config => {
        config.resolve.alias.set("@", resolve("src"))
    }

}